import { createApp } from 'vue';
import "./assets/css/iconfont.css";
import "./assets/css/Joystick.css";
import App from './App.vue';

import { HttpClient, WsClient } from "tsrpc-browser";
import { GateClient } from '../assets/shared/gateClient/gateClient';
import { GameClient } from '../assets/shared/gameClient/gameClient';

//实现当前客户端的全局定义函数
globalThis.getGateClient = (gateServerUrl: string): GateClient => {
    return new GateClient((proto, opt) => {
        return new HttpClient(proto, opt);
    }, gateServerUrl);
};
globalThis.getGameClient = (serverUrl: string): GameClient => {
    return new GameClient((proto, opt) => {
        return new WsClient(proto, opt);
    }, serverUrl);
};

const app = createApp(App);
app.mount('#app');
